package com.ruyuan.authorization;

import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.permission.RolePermissionResolver;

import java.util.Arrays;
import java.util.Collection;

/**
 * @author xx
 */
public class MyRolePermissionResolver implements RolePermissionResolver {

    @Override
    public Collection<Permission> resolvePermissionsInRole(String roleString) {
        if ("myRole".equals(roleString)) {
            return Arrays.asList(new MyPermission("+salary+4+7"), new MyPermission("+salary+1"));
        }
        return null;
    }

}
